package com.blt.car;

import android.app.Application;
import android.content.Context;
//import android.support.multidex.MultiDex;
//import android.util.Log;

import com.baidu.mapapi.SDKInitializer;
//import com.blt.car.psuh.UmengNotificationService;
//import com.umeng.message.IUmengRegisterCallback;
//import com.umeng.message.PushAgent;

import blt.a3rd.map.MapSdk;
import blt.app_core.api.base.CoreManager;
import blt.app_core.log.Logger;
import blt.app_core.utils.CacheUtil;
import blt.app_core.utils.CommonPref;
import blt.app_core.utils.PreferencesConstant;

/**
 * Created by xgp on 2017/6/11.
 */

public class CarApp extends Application {

    static CarApp carApp;

    public static Context getContext() {
        return carApp;
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
//        MultiDex.install(this);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        carApp = this;
        CommonPref.getInstance().init(this, PreferencesConstant.PREFERENCES_NAME);
        CoreManager.init(this);
        Logger.init();
        CacheUtil.getCache().init(this);
        MapSdk.getMapSdk().initSdk(this);
        SDKInitializer.initialize(this);
//        inintPush();

    }



//    private void inintPush() {
//        PushAgent mPushAgent = PushAgent.getInstance(this);
//        mPushAgent.register(new IUmengRegisterCallback() {
//
//            @Override
//            public void onSuccess(String deviceToken) {
//                //注册成功会返回device token
//                Log.d("App", "deviceToken:" + deviceToken);
//            }
//
//            @Override
//            public void onFailure(String s, String s1) {
//
//            }
//        });
//        mPushAgent.setPushIntentServiceClass(UmengNotificationService.class);
//
//    }
}
